/******************************************************************************************
 
Made by www.Flashphoner.com, all rights reserved.
These sources can only be used for working with Flashphoner server.
If you want use this to create your own application (separate from Flashphoner server) � 
please contact support@flashphoner.com 

******************************************************************************************/

package com.flashphoner.phone
{
	import com.flashphoner.api.Flash_API;
	import com.flashphoner.phone.views.CallView;
	import com.flashphoner.phone.views.IncomingView;
	import com.flashphoner.phone.views.MicrophoneSettingsView;
	import com.flashphoner.phone.views.PhoneButton;
	import com.flashphoner.phone.views.SipAccountView;
	import com.flashphoner.phone.views.TransferView;
	import com.flashphoner.phone.views.VersionView;
	
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	
	import mx.collections.ArrayCollection;
	import mx.controls.List;
	
	public class DataPhone
	{
		private static var data:DataPhone;
		public function DataPhone()
		{
		}
		public static function getInstance():DataPhone{
			if (data == null){
				data = new DataPhone();
				data.flash_API = new Flash_API();
			}
			return data;
		}
		
		public var flash_API:Flash_API;
		
		public var viewController:ViewControllerPhone = new ViewControllerPhone();
		
		public var listCalls:List;
		
		public var incommingView:IncomingView = new IncomingView();
		
		public var transferView:TransferView = new TransferView();		
		
		public var sipAccountView:SipAccountView = new SipAccountView();
		
		public var microphoneSettingsView:MicrophoneSettingsView = new MicrophoneSettingsView();
		
		public var versionView:VersionView;		
		
		public function getCallView(callId:String):CallView{
			var index:Number = flash_API.getIndexByCallId(callId);
			var obj:* = listCalls.indexToItemRenderer(index);
			return obj as CallView;
			
		}
	}
}